<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();
$plugin_name='jy_weishop';
if($_RQ['op']=='get' || $_RQ['op']=='tool'){
	$plugins=plugin('jy_weishop')->plugins();
	unset($plugins[0]);
	if($_RQ['title']){
		$return['params']['title']=$_RQ['title'];
		foreach($plugins as &$pv){
			foreach($pv['list'] as $k=>$lv){
				if(strpos($lv['title'],$_RQ['title']) !== false){ 
					
				}else{
					unset($pv['list'][$k]);
				}
			}
		}
	}
	if($_RQ['op']=='tool'){
		unset($plugins[0]);
	}
	$getapps = cache_read('plugin_getapps','jy_weishop');
	if(!$getapps){
			$getapps=cloud_request('release.get_plugins.list',array('names'=>$noplugins),'',true);
			cache_write('plugin_getapps',$getapps,'jy_weishop');
	}
	$return['setplugins']=$setplugins;
	$getapps=json_decode($getapps,true);
	$return['item']['inplugins']=$plugins;
	$return['item']['noplugins']=$getapps['list'];
	$htmls=array(
		'type' => 'look',
		'desc' =>'应用',
		'look' => array(
			array('type'=>'search_one','title'=>'应用名称','name'=>'title'),
			array('type'=>'plugins','title'=>'商城应用','style'=>2,'pluginname'=>$plugin_name,'name'=>'inplugins'),
		)
	);
	if($_SESSION['isfounder']){
		$htmls['look'][]=array('type'=>'plugins','title'=>'待安装应用','style'=>3,'pluginname'=>$plugin_name,'name'=>'noplugins');
	}
	$return['htmls']=$htmls;
	set_html('title','应用面板');
	exi($return);
}

?>